{include file="public/_meta" /}
<body>
<style>
    .required_b{
        color: red;
    }
</style>
<div class="wrapper">

    {include file="public/_header" /}

    <!-- Sidebar -->
    {include file="public/_menu" /}
    <!-- End Sidebar -->

    <div class="main-panel">

        <div class="content">
            <div class="page-inner">

                <!-- 面包屑 -->
                {include file="public/_page_header" /}

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="d-flex align-items-center">
                                    <h4 class="card-title">ROI</h4>
                                </div>

                                <form class="row">


                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="name" value="{$name}" placeholder="管理员名称">
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="times" id="times" value="{$times}" placeholder="创建时间" autocomplete="off">
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <select class="form-control input-full" name="admin_id[]" id="admin_id" multiple="multiple">
                                                {volist name="admin_array" key="k" id="vo"}
                                                <option value="{$vo['uid']}">{$vo['realname']}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <button type="submit" class="btn btn-primary">查询</button>
                                            <a href="{:url('stat_push/adminRoi')}" class="btn btn-info" style="color: white;position: absolute;left: 110px;">重置</a>
                                        </div>
                                    </div>

                                </form>

                            </div>

                            <div class="layui-card-body">

                                <blockquote class="layui-elem-quote layui-quote-nm">
                                    <div class="table-responsive">
                                        <table id="add-row2" class="display table table-striped table-hover" >
                                            <thead>
                                            <tr>
                                                <th>账户币成本</th>
                                                <th>真实币成本</th>
                                                <th>分发总金额</th>
                                                <th>赠送金额</th>
                                                <th>充值服务币</th>
                                                <th>商户账户币欠费金额</th>
                                                <th>收益</th>
                                                <th>收益率</th>
                                                <th>ROI</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>{$all_xz_price3}</td>
                                                <td>{$all_xz_true_price3}</td>
                                                <td>{$all_money}</td>
                                                <td>{$all_song}</td>
                                                <td>{$fw_money}</td>
                                                <td>{$owe_money2}</td>
                                                <td>{$all_balance}</td>
                                                <td>{$all_song_rate}%</td>
                                                <td>{$roi_money}</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </blockquote>
                            </div>

                            <div class="card-body">
                                <!-- Modal -->



                                <div class="table-responsive">
                                    <table id="add-row" class="display table table-striped table-hover" >
                                        <thead>
                                        <tr>
                                            <th>账号</th>
                                            <th>名称</th>
                                            <th>账户币成本</th>
                                            <th>真实币成本</th>
                                            <!--<th>账户币成本</th>
                                            <th>真实币成本</th>
                                            <th>账户币空耗成本</th>
                                            <th>真实币空耗成本</th>-->
                                            <th>分发总金额</th>
                                            <th>赠送金额</th>
                                            <th>充值服务币</th>
                                            <th>商户账户币欠费</th>
<!--                                            <th>真实币欠费</th>-->
                                            <th>有效收益</th>
                                            <th>收益</th>
                                            <th>收益率</th>
                                            <th>ROI</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>

                                        <tbody>

                                        {volist name="infos" id="vo"}
                                        <tr>
                                            <td>{$vo.phone}</td>
                                            <td>{$vo.realname}</td>
                                            <td>{$vo.xz_price3}</td>
                                            <td>{$vo.xz_true_price3}</td>
                                            <td>{$vo.all_money}</td>
                                            <td>{$vo.song_money}</td>
                                            <td>{$vo.fw_money}</td>
                                            <td><a href="{:url('admin/oweDetails',['aid'=>$vo.uid,'type'=>1,'times'=>$times])}">{$vo.owe_money2}</a></td>
                                            <td>{$vo.valid_money}</td>
                                            <td>{$vo.shouyi_money}</td>
                                            <td>{$vo.shouyi_rate}%</td>
                                            <td>{$vo.roi_money}</td>
                                            <td><a style="font-weight: bolder; color: #0b3892;" href="merchRoi?admin_id={$vo.uid}&times={$times}">商户ROI明细</a></td>
                                        </tr>
                                        {/volist}

                                        </tbody>
                                    </table>

                                    <!-- 分页 (调取通用方法)-->

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>

        {include file="public/_footer" /}


    </div>



</div>

{include file="public/_js" /}

</body>
<link rel="stylesheet" href="__STATIC__/multiple-select-1.6.0/dist/multiple-select.css">
<script src="__STATIC__/multiple-select-1.6.0/dist/multiple-select.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">

    function recostprice(){
        var times=$('#times').val();
        layer.confirm('确认要刷新成本吗？',function(index){
            var loading = layer.load('加载中...', {
                shade: [0.3,'#fff'] //0.1透明度的白色背景
            });
            $.ajax({
                type: 'POST',
                url: "{:url('Admin/reMoneyCostQueue')}",
                dataType: 'json',
                data: {times:times},
                success: function(data){
                    layer.close(loading);
                    if(data.code == 1001){
                        layer.msg(data.msg,{icon:1,time:2000});
                    }else{
                        layer.msg(data.msg,{icon:2,time:2000});
                    }

                },
                error:function(data) {
                    layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
                }
            });
        });
    }
    laydate.render({
        elem: '#times'
        ,type: 'date'
        ,range: true
    });

    $('#pro_id').val('{$pro_id}');


    $('#admin_id').multipleSelect({
        selectAll:true, //是否有全选按钮
        placeholder: "请选择管理员"
    });
    var sceneIdList ="{$admin_id}";
    sceneIdArr = sceneIdList.split(",");
    $('#admin_id option').each(function (i, content) {
        if ($.inArray($.trim(content.value), sceneIdArr) >= 0) {
            this.selected = true;
        }
    });
    //加载完勾选项后也要刷新
    $("#admin_id").multipleSelect('refresh');

</script>
</html>